#include "transContentPortRecord.hpp"

int TransContentPortRecord::response(char* buffer, int index){
	int mainCode= buffer[0];
	int subCode = buffer[1];
	debug_enter();
	if(mainCode != message_type_out_data_packet){
		logd_info("port record response, main code not data packet, this packet should be passed continue");
		return RESPONSE_RESULT_POST_CONITNUE;
	}
	switch(subCode){
		case message_type_data_packet_sub_dataIn:
			logd_info("port record response, data in! call inMemory to response it");
			InMemory->response(buffer);
		default:
			logd_error("port record response, not support sub protocol");
	}
	logd_info("port record response, start to release the response buffer");
	TransContentMemory::getInstance()->releaseBuffer(index);
	return RESPONSE_RESULT_NOACTION;
}
